<form action="<?php e_page("order","service");?>" method="get">
    <fieldset>
        <legend></legend>
        <label for="shopId">商家选择</label>
        <select name="shopId" id="shopId">
            <option value="">所有</option>
            <?php foreach($r['shop_info'] as $v){?>
                <option value="<?php echo $v['id']?>" <?php if($r['shopId']==$v['id']) echo 'selected';?>><?php echo $v['company']?></option>
            <?php }?>
        </select>
        <label for="service_id">服务站选择</label>
        <select name="service_id" id="service_id">
            <option value="">所有</option>
            <?php foreach($r['service_info'] as $v){?>
                <option value="<?php echo $v['id']?>" <?php if($r['service_id']==$v['id']) echo 'selected';?>><?php echo $v['service_name']?></option>
            <?php }?>
        </select>
        <label for="state">订单状态选择</label>
        <select name="state" id="state">
            <option value="">所有</option>
            <?php foreach($r['orderState'] as $k=>$v){?>
                <option value="<?php echo $k;?>"><?php echo $v;?></option>
            <?php }?>
        </select>
        <label for="real_name">用户姓名</label><br/>
        <input type="text" name="real_name" id="real_name" placeholder="请输入用户姓名"><br/>
        <label for="tel">用户手机号</label><br/>
        <input type="text" name="tel" id="tel" placeholder="请输入用户手机号">
        <input type="submit">
    </fieldset>
</form>
<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>订单当前状态</th>
        <th>商家信息</th>
        <th>服务站信息</th>
        <th>用户姓名</th>
        <th>用户手机号</th>
        <th>订单金额</th>
        <th>付款金额</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['order_info'] as $v){?>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?php foreach($r['orderState'] as $k=>$s){?>
            <?php if($v['state']==$k) echo $s; ?>
            <?php }?></td>
            <td><?php echo $v['company'];?></td>
            <td><?php echo $v['service_id']?></td>
            <td><?php echo $v['user_id']?></td>
            <td><?php echo $v['shop_id']?></td>
            <td><?php echo $v['order_amount'];?></td>
            <td><?php echo $v['payment_amount'];?></td>
            <td><a href="<?php e_action("detail","id={$v['id']}")?>">查看详情</a></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<?php
/** @var Page $page */
$page=$r['pages'];
?>
<?php echo $page->getPageHtml(); ?>